package com.xiaomi.eco.scheduler;

import com.xiaomi.cloud.plan.client.plan.PlanExecutor;
import com.xiaomi.cloud.plan.client.spring.annotation.PlanTask;
import com.xiaomi.eco.mapper.EcoMethodDimensionEntityMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

@Slf4j
@PlanTask(name = "getEcoClearData", quartzCron = "0 0 10 ? * 7", description = "每7天清除应用服务冗余数据")
public class EcoClearDataTask implements PlanExecutor {

    @Autowired
    EcoMethodDimensionEntityMapper ecoMethodDimensionEntityMapper;
    @Override
    public void execute() {
        try {
            ecoMethodDimensionEntityMapper.ClearData();
        }catch (Exception e){
            log.info("定期清除数据失败 {}");
        }
    }
}
